home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: news.sprintlink.net!eskimo!scs
- From: scs@eskimo.com (Steve Summit)
- Subject: Re: *-* Help Array 640x480 *-*
- X-Nntp-Posting-Host: eskimo.com
- Message-ID: <DMItxy.Cy9@eskimo.com>
- Sender: news@eskimo.com (News User Id)
- Organization: schmorganization
- References: <4fb7ft$cqa@acmez.gatech.edu>
- Date: Fri, 9 Feb 1996 18:27:33 GMT
-
- In article <4fb7ft$cqa@acmez.gatech.edu>, gt5512b@prism.gatech.edu
- (Israel Denis Jr.) writes:
- > I am trying to write some code for image processing
- > using a PC (dos)... I am running into some problems with borlandc
- > not letting me create arrays that are this big...
- >
- > I know that this could be implemented with pointers
- > but I need to do this specifically with an array.
-
- If it simply has to be a true array, you may be out of luck, and
- it can be tricky to get large amounts of contiguous memory at all
- on that benighted platform.
-
- Here's what the comp.lang.c FAQ list has to say:
-
- 19.23: How can I allocate arrays or structures bigger than 64K?
-
- A: A reasonable computer ought to give you transparent access to
- all available memory. If you're not so lucky, you'll either
- have to rethink your program's use of memory, or use various
- system-specific techniques.
-
- 64K is (still) a pretty big chunk of memory. No matter how much
- memory your computer has available, it's asking a lot to be able
- to allocate huge amounts of it contiguously. (The C Standard
- does not guarantee that a single object can be larger than 32K.)
- Often it's a good idea to use data structures which don't
- require that all memory be contiguous. For dynamically-
- allocated multidimensional arrays, you can use pointers to
- pointers, as illustrated in question 6.16. Instead of a large
- array of structures, you can use a linked list, or an array of
- pointers to structures.
-
- If you're using a PC-compatible (8086-based) system, and running
- up against a 640K limit, consider using "huge" memory model, or
- expanded or extended memory, or malloc variants such as halloc()
- or farmalloc(), or a 32-bit "flat" compiler (e.g. djgpp, see
- question 18.3), or some kind of a DOS extender, or another
- operating system.
-
- References: ANSI Sec. 2.2.4.1; ISO Sec. 5.2.4.1.
-
- Steve Summit
- scs@eskimo.com
- --
-
- The Communications Decency Act within the Telecommunications Act
- of 1996 (U.S.) is an annoying, threatening, abusive, indecent,
- and obscene piece of legislation which attempts to ban annoying,
- threatening, abusive, indecent, or obscene communication.
-